// 
app.launchPackage('com.android.settings')
sleep(1000)
scrollForward()
text('帐号').findOne().parent().parent().click()
sleep(1000)
// 移除原有的登录账号
text("Google").find().forEach(item => {
    item.parent().parent().parent().click()
    text("移除帐号").findOne().click()
    sleep(1000)
    text("移除帐号").findOne().click()
    sleep(2000)
})


let accs = [    {
    "acc": "wm90351058@nibley.me",
    "pass": "qwer1234"
},
{
    "acc": "wm90598151@nibley.me",
    "pass": "qwer1234"
},
{
    "acc": "wm90605845@nibley.me",
    "pass": "qwer1234"
},
{
    "acc": "wm90627946@nibley.me",
    "pass": "qwer1234"
},
{
    "acc": "wm90728151@nibley.me",
    "pass": "qwer1234"
},]


accs.forEach(item => {
    let { acc, pass } = item

    // 登录账号
    console.log('添加帐号');
    text("添加帐号").findOne().parent().parent().parent().click()
    
    className("android.widget.EditText").findOne().setText(acc)
    console.log('下一步');
    text("下一步").findOne().click()
    text("忘记了密码？").findOne()
    sleep(1000)
    className("android.widget.EditText").findOne().setText(pass)
    sleep(1000)
    console.log('下一步');
    text("下一步").findOne().click()

    text("我同意").findOne().click()
    sleep(2000)

})
